import QtQuick 2.15
import QtQuick.Controls 2.15
import QtGraphicalEffects 1.15
import './../../../controls'
//选择兑换类型 成人还是儿童
Popup {
    id:pop
    width: 400
    height: 300
    modal: true
    anchors.centerIn: parent
    property var pWin: null
    property var callBack:null
    property string bno: ''
    closePolicy:Popup.NoAutoClose
    background:BorderImage {
        anchors.fill: parent
        anchors.leftMargin: -16
        anchors.rightMargin: -16
        anchors.topMargin: -12
        anchors.bottomMargin: -20
        border.left: 16
        border.right: 16
        border.top: 12
        border.bottom: 20
        source: "qrc:/images/DialogFrame3.png"
    }
    onClosed:{
        pop.destroy()
    }

    contentItem: Item {
        anchors.fill: parent
        anchors.margins: 20

        Row{
            anchors.centerIn: parent
            spacing: 40
            Button{
                width: 150
                height: 150
                background:Rectangle
                {
                    border.color:'#dddddd'
                    radius:5
                    Column{
                        anchors.centerIn: parent
                        spacing: 20
                        Image {
                            anchors.horizontalCenter: parent.horizontalCenter
                            source: "qrc:/images/main/chengren.png"
                        }
                        Text {
                            color: '#333333'
                            anchors.horizontalCenter: parent.horizontalCenter
                            text: qsTr("成人票")
                        }
                    }
                }
                onClicked: {
                    if(callBack)
                    {
                         callBack(0,bno)
                    }
                    pop.close()
                }
            }
            Button{
                width: 150
                height: 150
                background:Rectangle
                {
                    border.color:'#dddddd'
                    radius:5
                    Column{
                        anchors.centerIn: parent
                        spacing: 20
                        Image {
                            anchors.horizontalCenter: parent.horizontalCenter
                            source: "qrc:/images/main/ertong.png"
                        }
                        Text {
                            color: '#333333'
                            anchors.horizontalCenter: parent.horizontalCenter
                            text: qsTr("儿童票")
                        }
                    }
                }
                onClicked: {
                    if(callBack)
                    {
                         callBack(1,bno)
                    }
                    pop.close()
                }
            }

        }


        Button{
            width: 32
            height: 32
            anchors.right: parent.right
            background: Image {
                anchors.centerIn: parent
                source: "qrc:/images/close.png"
            }
            onClicked: {
                pop.close()
            }
        }
    }
}
